/*
 * ChoosePayWayActivity.java
 * business
 *
 * Created by chentao on 2017/5/2.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.main.shoppingcart.choosepayway;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import com.yidiandao.business.R;
import com.yidiandao.business.base.BaseActivity;
import com.yidiandao.business.data.model.ConfirmOrderModel;
import com.yidiandao.business.utils.ActivityUtils;

/**
 * 选择支付方式-Activity.
 */
public class ChoosePayWayActivity extends BaseActivity {

    private ChoosePayWayFragment mChoosePayWayFragment;

    public static void actionStart(Activity activity) {
        Intent intent = new Intent(activity, ChoosePayWayActivity.class);
        activity.startActivity(intent);
    }

    @Override
    protected void initFragment() {
        mChoosePayWayFragment = (ChoosePayWayFragment) getSupportFragmentManager().findFragmentById(R.id.container_choose_pay_way);

        if (mChoosePayWayFragment == null) {
            mChoosePayWayFragment = ChoosePayWayFragment.getInstance();
            ActivityUtils.addFragmentToActivity(getSupportFragmentManager(), mChoosePayWayFragment, R.id.container_choose_pay_way);
        }

    }

    @Override
    protected void initPresenter() {
        Bundle bundle = getIntent().getExtras();
        new ChoosePayWayPresenter(mChoosePayWayFragment, new ConfirmOrderModel(), bundle);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_choose_pay_way;
    }
}
